package pl.gpms.server.persistance.map;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import pl.gpms.client.dto.DefectDictDTO;

@Entity
@Table(name = "D_DEFECT")
public class DefectDict implements Serializable {

	private static final long serialVersionUID = 3888940678316286508L;
	private String defectName;
	private double defectConfidence = 0.0;
	
	public DefectDict() {}
	public DefectDict( String illnessName ) {
		this.defectName = illnessName;
	}
	public DefectDict( String illnessName, double illnessConfidence ) {
		this.defectName = illnessName;
		this.defectConfidence = illnessConfidence;
	}
	
	public DefectDict( DefectDictDTO defectDict ) {
		this.defectName = defectDict.getDefectName();
		this.defectConfidence = defectDict.getDefectConfidence();
	}
	
	@Id
	@Column( name = "DEFECT_NAME", unique = true, nullable = false, length = 50 )
	public String getDefectName() {
		return defectName;
	}
	
	public void setDefectName( String defectName ) {
		this.defectName = defectName;
	}
	
	@Transient
	public double getDefectConfidence() {
		return this.defectConfidence;
	}
	
	public void setDefectConfidence( double defectConfidence ) {
		this.defectConfidence = defectConfidence;
	}
}
